let box = document.querySelectorAll('#back>.content>.change_box')
let change = document.querySelectorAll('#back>.content>.content_change')
for (let i = 0; i < box.length; i++) {
    box[i].addEventListener('click', function () {
        for (let j = 0; j < box.length; j++) {
            box[j].classList.remove('onhide')
            change[j].classList.add('none')
        }
        box[i].classList.add('onhide')
        change[i].classList.remove('none')
    })

}

let yzm = document.querySelector('#back>.content>.content_change>.yaz_box>span')
let yzmnub = document.querySelector('#back>.content>.content_change>.yaz_box>input')
let nub = document.querySelector('#back>.content>.content_change>.nub>input')
let rr = Math.random().toString(16).slice(2, 6)
let n = 5;
yzm.addEventListener('click', function () {
    yzm.textContent = `验证码(${n}s)`
    let timer = setInterval(function () {
        n--;
        yzm.textContent = `验证码(${n}s)`
        if (n <= 0) {
            yzm.textContent = `获取验证码`
            clearInterval(timer)
            n = 5
            alert(`${rr}`)
        }
    }, 1000)
})
nub.addEventListener('change', function () {
    if (nub.value !== rr) {
        alert('验证码输入错误')
    } else {
        alert('登录成功')
    }
})


let forget = document.querySelector('#back>.content>.content_change>.ccc>span')
forget.addEventListener('click', function () {
    alert('只有猪记不住自己密码')
})